<!DOCTYPE html>
<html lang="zh">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>ydownload</title>
  <style>
    body {
      box-sizing: border-box;
      font-size: 12px;
    }

    .container {
      margin: 0 auto;
      width: 800px;
      display: flex;
      justify-content: left;

    }

    .sreach-top {
      margin: 0 auto;
      width: 800px;
      display: flex;
      justify-content: left;
      flex-direction: column;
      margin-bottom: 20px;
    }

    .sreach-top>div {
      margin: 5px 0;
    }

    ul {
      list-style-type: none;
      padding-left: 0;
    }

    li {
      padding: 8px;
    }

    .left {
      width: 80px;
    }

    .left ul {
      font-weight: bold;

    }

    .left ul li {
      border-left: 4px solid white;
    }

    .left ul li:hover {
      color: #4d90fe;
      cursor: pointer;
    }

    .title {
      font-weight: bold;
      position: relative;
      display: inline-block;
      padding-left: 0;
    }

    .title::after {
      content: '';
      position: absolute;
      bottom: 0;
      left: 0;
      width: 90%;
      border-bottom: 4px solid salmon;
    }

    .left ul li.activate {
      border-left: 4px solid salmon;
    }

    .right {
      width: 100%;
    }

    .right>div {
      display: none;
    }

    .right .sub-activate {
      display: block;
    }


    .info {
      padding-left: 0;
    }


    .downloading .info {
      display: flex;
      justify-content: left;
      align-items: center;
    }


    .downloaded .info {
      display: flex;
      justify-content: left;
      align-items: center;
    }

    .file-name {
      display: inline-block;
      width: 180px;
      margin-left: 20px;
    }

    .file-speed {
      margin-left: 20px;
      color: #ff5722;
    }

    .file-size {
      margin-left: 10px;
      color: green;
    }

    .file-prog {
      margin-left: 10px;
      color: #795548;
    }

    .file-download {
      margin-left: 10px;
    }

    .file-cancel {
      margin-left: 10px;
    }
    .file-delete {
      margin-left: 10px;
    }


    input[type="text"] {
      padding: 4px 8px;
      border: 2px solid #ddd;
      border-radius: 5px;
      background-color: #fff;
      color: #333;
      box-sizing: border-box;
      transition: all 0.3s ease;
    }

    input[type="text"]:focus {
      border-color: #4d90fe;
      box-shadow: 0 0 8px rgba(77, 144, 254, 0.5);
      outline: none;
    }


    input[type="text"]::placeholder {
      color: #888;
      font-style: italic;
    }

    .switch {
      position: relative;
      display: inline-block;
      width: 60px;
      height: 34px;
    }

    .switch input {
      opacity: 0;
      width: 0;
      height: 0;
    }

    .slider {
      position: absolute;
      cursor: pointer;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background-color: #ccc;
      transition: 0.4s;
      border-radius: 50px;
    }

    .slider:before {
      content: "";
      position: absolute;
      height: 26px;
      width: 26px;
      border-radius: 50%;
      background-color: white;
      left: 4px;
      bottom: 4px;
      transition: 0.4s;
    }

    input:checked+.slider {
      background-color: #4d90fe;
    }

    input:checked+.slider:before {
      transform: translateX(26px);
    }

    button {
      background-color: #4d90fe;
      border: none;
      color: white;
      padding: 5px 10px;
      text-align: center;
      text-decoration: none;
      display: inline-block;
      margin: 4px 2px;
      cursor: pointer;
      border-radius: 4px;
      transition: all 0.3s ease;
    }

    button:hover {
      background-color: #649cf5;
    }

    button:focus {
      outline: none;
    }

    select {
      height: 30px;
      padding: 4px 8px;
      border: 2px solid #ddd;
      border-radius: 5px;
      background-color: #fff;
      color: #333;
      box-sizing: border-box;
      transition: all 0.3s ease;
      cursor: pointer;
      appearance: none;
      -webkit-appearance: none;
      -moz-appearance: none;
      background: #f7f7f7;
      background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 12"%3E%3Cpath d="M6 8l4-4H2z" fill="%234d90fe"/%3E%3C/svg%3E');
      background-position: right 10px center;
      background-repeat: no-repeat;
      background-size: 12px 12px;
    }

    select:hover,
    select:focus {
      border-color: #4d90fe;
      box-shadow: 0 0 8px rgba(77, 144, 254, 0.5);
      outline: none;
    }

    option {
      margin: 5px;
    }

    .setting .info {
      display: flex;
      justify-content: left;
      align-items: center;
    }

    .setting .info>input {
      margin: 0 20px;
    }

    .setting .info span:nth-child(1) {
      display: inline-block;
      width: 120px;
    }

    .loading button {
      background-color: gray;
      cursor: not-allowed;
    }

    img {
      height: 30px;
    }

    #modal {
      display: none;
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background-color: rgba(0, 0, 0, 0.8);
      align-items: center;
      justify-content: center;
    }

    #modal img {
      height: 60%;
      border: 5px solid white;
    }
    
    .sreach-download{
      display: flex;
      align-items: center;
    }

  </style>

</head>

<body>
  <div class="sreach-top">
    <div>
      <input type="text" class="sreach-text" style="width: 360px;" />
      <button class="sreach-btn">搜索</button>
    </div>
    <div class="sreach-download">
      <select class="download-select" style="width: 200px;">
      </select>
      <button class="download-btn" style="margin-left: 20px;">下载</button>
      <img class="sreach-img" style="margin-left: 20px;" >
    </div>
  </div>
  <div class="container">
    <div class="left">
      <ul>
        <li class="activate">下载中</li>
        <li>已完成</li>
        <li>设置</li>
      </ul>
    </div>
    <div class="right">
      <div class="downloading sub-activate">
        <ul>
          <li class="title">下载中</li>
          <li>&nbsp;</li>
          <ul class="list">
          </ul>
        </ul>
      </div>
      <div class="downloaded">
        <ul>
          <li class="title">已完成</li>
          <li>&nbsp;</li>
          <ul class="list">
          </ul>
        </ul>
      </div>
      <div class="setting">
        <ul>
          <li class="title">设置</li>
          <li>&nbsp;</li>
          <li class="info">
            <span>服务端地址</span>
            <input type="text" placeholder="http://localhost:3000" class="server-url" />
          </li>
        </ul>
      </div>

    </div>
  </div>

  <div id="modal">
    <img id="modalImage" src="" alt="Large Image">
  </div>

  <template id="downloading-template">
    <li class="info" uid="{{uid}}" fileName="{{fileName}}">
      <img class="file-image" src="{{apiUrl}}/download/{{uid}}.webp" />
      <span class="file-name">{{fileName}}</span>
      <span class="file-prog">{{prog}}</span>
      <span class="file-size">{{size}}</span>
      <span class="file-speed">{{speed}}</span>
      <a href="#"  class="file-cancel">取消</a>
    </li>
  </template>

  <template id="downloaded-template">
    <li class="info" uid="{{uid}}" fileName="{{fileName}}">
      <img class="file-image" src="{{apiUrl}}/download/{{uid}}.webp" />
      <span class="file-name">{{fileName}}</span>
      <span class="file-size">{{size}}</span>
      <a href="{{apiUrl}}/download/{{fileName}}" class="file-download" target="_blank">下载</a>
      <a href="#"  class="file-delete" >删除</a>
    </li>
  </template>

  <script src="sidepanel.js"></script>



</body>

</html>